package cn.com.zhuxulin.android.demos.bussiness;

import java.io.IOException;

import android.content.Context;
import android.content.res.AssetManager;

public class GetResources {
	private Context context = null;
	private AssetManager assetManager = null;

	public GetResources(Context context) {
		this.context = context;
	}
	/**
	 * get resources from asset folder
	 * @param fileName
	 * @throws IOException
	 */
	public void getFromAsset(String fileName) throws IOException {
		assetManager = this.context.getResources().getAssets();
		assetManager.openNonAssetFd(fileName);
		assetManager.open(fileName, AssetManager.ACCESS_BUFFER);
	}

	public void getFromRaw(int rawId) {
		context.getResources().openRawResource(rawId);
	}
}
